// WorldObject.h provides the attributes of the WorldObject class
//-----------------

#if !defined( WorldObjectH)
#define WorldObjectH

//-----------------
// Includes various libraries and files
#include <cassert>		// for asserts
#include <d3dx9.h>		// Direct 3D library (for all Direct 3D functions)

#include "Mesh.h"
//-----------------

class WorldObject {
	public:
		// constructors
		WorldObject();
		WorldObject( const float x, const float y, const float z, bool ib, bool d);
		WorldObject( const WorldObject& wo);

		// accessors
		Mesh* get_mesh() const;
		std::string get_file_name() const;

		float get_x() const;
		float get_y() const;
		float get_z() const;
		D3DXVECTOR3 get_position() const;
		float get_true_x() const;
		float get_true_y() const;
		float get_true_z() const;
		D3DXVECTOR3 get_true_position() const;
		float get_x_dimension() const;
		float get_y_dimension() const;
		float get_z_dimension() const;
		D3DXVECTOR3 get_dimensions() const;
		float get_rotation() const;

		bool breakable() const;
		int get_health_current() const;
		int get_health_maximum() const;
		bool destroyed() const;

		virtual void collision( D3DXVECTOR3& player_pos) const;

		// mutators
		void set_mesh( Mesh* m);

		void set_x( const float& x);
		void set_y( const float& y);
		void set_z( const float& z);
		void set_location( const float& x, const float& y, const float& z);
		void set_x_dimension( const float& x);
		void set_y_dimension( const float& y);
		void set_z_dimension( const float& z);
		void set_dimensions( const float& x, const float& y, const float& z);
		void set_rotation( const int& r);
		
		void set_breakable( const bool b);
		void set_health( const int& h);
		void set_health_maximum( const int& h);
		void set_destroyed( const bool d);

		virtual void render();

		//virtual void react_to_gravity();

		// overloaded operator
		bool operator ==( const WorldObject& w) const;

	private:
		Mesh* mesh_;
		std::string file_name_;
		D3DXVECTOR3 position_, dimensions_;
		int rotation_;
		int health_current_, health_maximum_;
		bool breakable_, destroyed_;
};

#endif